import java.util.*;

public class Main
{
    public static void main(String []args)
    {
	Locale.setDefault(Locale.US);
	Scanner in = new Scanner(System.in);
	double lambda = in.nextDouble();
	Random rnd = new Random();
	int N = 10000;
	double []A = new double [N + 1];
	int len = in.nextInt();
	double pua[] = new double [len];
	double constant = Math.pow(Math.E, -lambda);
	for (int i = 0; i <= N; ++i)
	    A[i] = rnd.nextDouble();
	for (int i = 0; i < len; ++i)
	{
	    for (int j = 0; j <= N; ++j)
		A[j] = rnd.nextDouble();
	    double p = 1.0;
	    int j  = 0;
	    while ( !( (p = p * A[j]) < constant) && j <= N)
		++j;
	    pua[i] = j;
	}
	double e = 0, d = 0;
	for (int i = 0; i < len; ++i)
	    e += pua[i];
	e /= len;
	for (int i = 0; i < len; ++i)
	    d += Math.pow(e - pua[i], 2.0);
	d /= (len - 1);
	System.out.println(d + "\t" + lambda);
	System.out.println(e + "\t" + lambda);

    }
}